package fr.webeo.teambuilder.gui;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

/**
 * Class used to get the correct labl according to the Locale Object used. *
 * 
 * @author Sébastien Bordes
 * @version $Revision: 1.3 $ $Date: 2007/08/27 07:12:28 $ $Name: $
 */
public class Messages {

    /** Name of the properties file. */
    private static final String BUNDLE_NAME = "fr.webeo.teambuilder.messages"; //$NON-NLS-1$

    /** The ressource bundle to use. */
    private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);

    /**
     * Default constructor.
     */
    private Messages() {
        // Nothing to do
    }

    /**
     * Get the correct string.
     * 
     * @param key key of the string to get
     * @return the correct label
     */
    public static String getString(String key) {
        try {
            return RESOURCE_BUNDLE.getString(key);
        } catch (MissingResourceException e) {
            return '!' + key + '!';
        }
    }
}
